 <?php
 
	if(!isset($_SESSION))
		session_start();
		
	if( empty($_SESSION['user']) )
	{
		header("Location: manage_login.php");
		exit;
	}	
	
	require_once ('./mysql_connect.php'); 
	
	$rez = mysqli_query($dbc,"SELECT `nume`,`grup`,`mail`,`judete` FROM anc.utilizatori WHERE mail='$_SESSION[user]'");	
	$rand = mysqli_fetch_row($rez);
	if( !empty($rand[0]) && !empty($rand[1]) )
	{
		if ( !defined('USERNAME') )
			define("USERNAME", $rand[0]);
		if ( !defined('GROUP') )
			define("GROUP", $rand[1]);
        if ( !defined('MAIL') )
			define ("MAIL", $rand[2]);
		if ( !defined('JUDETE') )
			define ("JUDETE", $rand[3]);
	}
 ?>